package sqlanalysisgui.view.model.provider;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.zest.core.viewers.EntityConnectionData;

import sqlanalysisgui.view.model.GraphNode;
import sqlanalysisgui.view.model.GraphNodeConnection;

public class GraphNodeLabelProvider  extends LabelProvider {
	  @Override
	  public String getText(Object element) {
	    if (element instanceof GraphNode) {
	      GraphNode GraphNode = (GraphNode) element;
	      return GraphNode.getName();
	    }
	    // Not called with the IGraphEntityContentProvider
	    if (element instanceof GraphNodeConnection) {
	      GraphNodeConnection GraphNodeConnection = (GraphNodeConnection) element;
	      return GraphNodeConnection.getLabel();
	    }

	    if (element instanceof EntityConnectionData) {
	      EntityConnectionData test = (EntityConnectionData) element;
	      return "";
	    }
	    throw new RuntimeException("Wrong type: "
	        + element.getClass().toString());
	  }


}
